if (!jsx3.lang.Class.forName("ux.cdb.admin.system.school.builder.Builder")) {
/**
 * Define the <code>tibco.spm.design.rule.builder.Builder</code> class.
 * This class inherit from <code>jsx3.gui.Dialog<code> GUI class.
 */
jsx3.Class.defineClass(
		"ux.cdb.admin.system.school.builder.Builder",
		jsx3.gui.Dialog,
		null,
		function (objRoot) {
			/**
			 * This method will be called after UI file has deserialized.
			 */
			objRoot.prototype.onAfterDeserialize = function() {
				this.wizard = this.get("steppedWizard");
				this.wizard.editMode = 'New';
				jsx3.log('School@Builder#onAfterDeserialize wizard : ' + this.wizard)
			};
			
			objRoot.prototype.onClose = function() {
				this.doClose();
			};
			
			objRoot.prototype.doSave = function() {
/* @JSC :: begin DEBUG */
				jsx3.log("school Builder#doSave : current data of step1 : " + this.wizard.cacheCDF.step1);
/* @JSC :: end */

				var __data = this.getData();
/* @JSC :: begin DEBUG */
				jsx3.log('save data type:' + typeof(__data) + ' data : ' + dwr.util.toDescriptiveString(__data, 5));
/* @JSC :: end */
				var doFunction = this.wizard.editMode == 'New' ? 'saveSchoolInfo' : 'updateSchoolInfo';
				ux.megatron.util.Dwr.callDwr("SchoolInfoUCC",doFunction,[__data],this,
					function(data){
						if (data != null && typeof data == 'object') 
							jsx3.log('school Builder#doSave return data : ' + dwr.util.toDescriptiveString(data, 5));
						//refresh data of parent matrix.
						ux.megatron.Main.getServer().getBodyBlock().get("blkSchoolWorld").doQuery(true);
						this.onClose();
					});
			};
				
			objRoot.prototype.getData = function() {
				var schoolInfo = {};
				if(this.wizard.editMode == 'Modify' && this.wizard.detailCDF.school)
					schoolInfo['partyId'] = this.wizard.detailCDF.school.partyId;
				if(this.wizard.cacheCDF.step1){
					var step1Itor = this.wizard.cacheCDF.step1.selectNodeIterator("//record");
					while(step1Itor.hasNext()){
						var node = step1Itor.next();
						var attrNames = node.getAttributeNames();
						for(var i = 0;i < attrNames.length;i++){
							var attr = node.getAttribute(attrNames[i]);
							schoolInfo[attrNames[i]] = (attr === "" ? null : attr);
						}
					}
				}
				if(this.wizard.cacheCDF.step2){
					var step2Itor = this.wizard.cacheCDF.step2.selectNodeIterator("//record");
					while(step2Itor.hasNext()){
						var node = step2Itor.next();
						var attrNames = node.getAttributeNames();
						for(var i = 0;i < attrNames.length;i++){
							var attr = node.getAttribute(attrNames[i]);
							schoolInfo[attrNames[i]] = (attr === "" ? null : attr);
						}
					}
				}
				return schoolInfo;
			};
		});
}